import Vue from 'vue'
import VueRouter from 'vue-router'
import Layout from '../components/Layout'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    redirect: '/webPage'
  },
  {
    path: '/webPage',
    name: 'webPage',
    component: Layout,
    redirect: '/webPage/home',
    children: [
      {
        path: 'login',
        name: 'login',
        component: () => import('@/views/web/login')
      },
      {
        path: 'home',
        name: 'webHome',
        component: () => import('@/views/web/home')
      }
    ]
  },
  {
    path: '/mobile/home',
    name: 'mHome',
    component: () => import(/* webpackChunkName: "mHome" */ '../views/mobile/home.vue')
  }
]

const router = new VueRouter({
  routes
})

export default router
